<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<title>注册</title>
<!-- for-mobile-apps -->
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Best Store Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" />
	<div th:include="css :: css"></div>
<!-- //animation-effect -->
</head>
	
<body>
<!-- breadcrumbs -->
	<div class="breadcrumbs">
		<div class="container">
			<ol class="breadcrumb breadcrumb1 animated wow slideInLeft" data-wow-delay=".5s">
				<li><a href="index.html"><span class="glyphicon glyphicon-home" aria-hidden="true"></span>主页</a></li>
				<li class="active">注册</li>
			</ol>
		</div>
	</div>
<!-- //breadcrumbs -->
<!-- login -->
	<div class="login" id="app">
		<div class="container">
			<h3 class="animated wow zoomIn" data-wow-delay=".5s">注册表单</h3>
			<div class="login-form-grids animated wow slideInUp" data-wow-delay=".5s">
				<form>
					<input type="text" placeholder="用户名"  v-model="user.name"  required="required" >
					<input type="text" placeholder="账号 "  v-model="user.code"  required="required" >
					<input type="text" placeholder="年龄"  v-model="user.age" required="required" >
					<!--<select   placeholder="性别"  v-model="user.sex"  class="form-control">-->
						<!--<option>男</option>-->
						<!--<option>女</option>-->
					<!--</select>-->
					<input type="text" placeholder="性别"  v-model="user.sex" required="required" >
					<input type="password" placeholder="密码" required="required" >
					<div class="forgot">
						<a href="/login">登陆</a>
					</div>
					<input type="button" id="log-btn" class="btn btn-warning" style="    width: 100%;" value="注册">
				</form>
			</div>
		</div>
	</div>
<!-- //login -->
<script>
    var app=new Vue({
        el:'#app',
        data:{
            user:{
                name:"",
                code:"admin",
                age:"",
                sex:"",
                pwd:"admin"
            }
        }
    });

    $("#log-btn").click(function(){
        console.log(app.user)
        $.ajax({
            url: '/user/register',
            type: 'post',
            dataType: 'json',
            async: false,
            data: app.user,
            success:function(data){
                console.log(data)
                if (data.code==1001){
					alert("注册成功，去登陆吧")
                } else{
                    alert("请从新注册")
                }
            },
            error:function(){

            }
        });

    });
</script>
</body>
</html>